package com.apps.diet.service;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Service;

import com.apps.diet.dao.IUserMealTypesDao;
import com.apps.diet.domain.UserMealTypes;

@Service("userMealTypesService")
//@Transactional
public class UserMealTypesService implements IUserMealTypesService {

	protected static Logger logger = Logger.getLogger(UserMealTypesService.class);
	
	IUserMealTypesDao userMealTypesDao;
	
	@Autowired
	@Required
	public void setDietDao(IUserMealTypesDao userMealTypesDao) {
		this.userMealTypesDao = userMealTypesDao;
	}

	@Override
	public List<UserMealTypes> getUserMealTypes(int searchString) {
		List<UserMealTypes> results = userMealTypesDao.getUserMealTypes(searchString);
		return results;
	}

	@Override
	public boolean updateUserMealTypes(UserMealTypes userMealTypes) {
		return userMealTypesDao.updateUserMealTypes(userMealTypes);
	}

	@Override
	public boolean createUserMealTypes(UserMealTypes userMealTypes) {
		return userMealTypesDao.createUserMealTypes(userMealTypes);
	}

	@Override
	public boolean deleteUserMealTypes(int userMealTypesId) throws Exception {
		return userMealTypesDao.deleteUserMealTypes(userMealTypesId);
	}
}
